<html>
<head>
<meta http-equiv=Content-Type content=text/html;charset=utf-8>
<#include "../inc/commonJs.html">
<script type="text/JavaScript">
	function doSave(){
		var nodes1 = $('#tree').tree('getChecked');
		var nodes2 = $('#tree').tree('getChecked','indeterminate');
		filterNodes(nodes1.concat(nodes2));
	}
	function filterNodes(nodes){
		var jscdArray = [];
		var cdmxArray = [];
		for(var i=0;i<nodes.length;i++){
			if(nodes[i].attributes){
				if(nodes[i].attributes.jscd){
					jscdArray.push(nodes[i].id);
				}
			}else{
				cdmxArray.push(nodes[i].id);
			}
		}
		$.post("setRoleAct.do", 
		   { "jsdm": "${obj.jsdm!}",
		   	"cddm":"xxfb",
		   	"fldm":"jscd",
		   	"jscd" : jscdArray.join(","),
		   	"ids": cdmxArray.join(",")
		   },
		   function(data){
		   	top.messagershow(data);
		   	top.windowObj.dialog('close');;
		});
	}
	//
	$(function(){
		$("#tree").tree({
            method: "post",
            lines: true,
            url: "listJsForTree.do?oskey=${obj.jsdm!}",
            dataPlain: true,       //该属性用以启用当前 easyui-tree 控件对平滑数据格式的支持
            toggleOnClick: false,
            checkbox: true,
            fit:true
        });
	})
</script>
</head>
<body >
<div class="easyui-panel" data-options='fit:true,border:false'>  
<ul id="tree"></ul>
</div>
</body>
</html>